home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  3.0 KB  |  102 lines  |  [TEXT/MPS ]

  1. {
  2.     CommResources.p
  3.     Pascal Interface to the Communications Resource Manager
  4.     
  5.     Copyright © Apple Computer, Inc. 1988-90
  6.     All rights reserved
  7. }
  8. {$IFC UNDEFINED UsingIncludes}
  9. {$SETC UsingIncludes := 0}
  10. {$ENDC}
  11.  
  12. {$IFC NOT UsingIncludes}
  13.     UNIT CommResources;
  14.     INTERFACE
  15. {$ENDC}
  16.  
  17. {$IFC UNDEFINED UsingCommResources}
  18. {$SETC UsingCommResources := 1}
  19.  
  20. {$I+}
  21. {$SETC CommResourcesIncludes := UsingIncludes}
  22. {$SETC UsingIncludes := 1}
  23. {$IFC UNDEFINED UsingOSUtils}
  24. {$I $$Shell(PInterfaces)OSUtils.p}
  25. {$ENDC}
  26.  
  27. {$SETC UsingIncludes := CommResourcesIncludes}
  28.  
  29. CONST
  30. {    current version of the CRM }
  31.     curCRMVersion     =     2;
  32.     
  33.  
  34. {    tool classes (also the tool file types)    }
  35.     classCM         =    'cbnd';
  36.     classFT         =    'fbnd';
  37.     classTM            =    'tbnd';
  38.     
  39. {    constants general to the use of the Communications Resource Manager }
  40.     crmType         =     9;                {queueType}
  41.     crmRecVersion    =     1;                {version of queue data structure}
  42.  
  43. {    error codes }
  44.     crmGenericError    =    -1;
  45.     crmNoErr        =    0;
  46.     
  47. TYPE
  48. {    data structures general to the use of the Communications Resource Manager }
  49.     CRMErr            =    OSErr;
  50.  
  51.     CRMRecPtr         = ^CRMRec;
  52.     CRMRec             = RECORD
  53.         qLink:             QElemPtr;      {reserved}
  54.         qType:             INTEGER;      {queue type -- ORD(crmType) = 9}
  55.         crmVersion:     INTEGER;    {version of queue element data structure}
  56.         crmPrivate:     LONGINT;    {reserved}
  57.         crmReserved:     INTEGER;       {reserved}
  58.         
  59.         crmDeviceType:     LONGINT;    {type of device, assigned by DTS}
  60.         crmDeviceID:     LONGINT;    {device ID; assigned when CRMInstall is called}
  61.         crmAttributes:     LONGINT;    {pointer to attribute block}
  62.                                     {device specific}
  63.         crmStatus:         LONGINT;    {status variable - device specific}
  64.  
  65.         crmRefCon:         LONGINT;    {for device private use}
  66.         END;
  67.  
  68. FUNCTION     InitCRM : CRMErr;
  69. FUNCTION     CRMGetHeader: QHdrPtr;
  70. PROCEDURE     CRMInstall(crmReqPtr: QElemPtr);
  71. FUNCTION     CRMRemove(crmReqPtr: QElemPtr): OSErr;
  72. FUNCTION     CRMSearch(crmReqPtr: QElemPtr): QElemPtr;    
  73. FUNCTION     CRMGetCRMVersion : INTEGER;
  74.  
  75. FUNCTION     CRMGetResource(theType : ResType; theID : INTEGER) : Handle;
  76. FUNCTION     CRMGet1Resource(theType : ResType; theID : INTEGER) : Handle;
  77. FUNCTION     CRMGetIndResource(theType : ResType; index : INTEGER) : Handle;
  78. FUNCTION     CRMGet1IndResource(theType : ResType; index : INTEGER) : Handle;
  79. FUNCTION     CRMGetNamedResource(theType : ResType; name : Str255) : Handle;
  80. FUNCTION     CRMGet1NamedResource(theType : ResType; name : Str255) : Handle;
  81. PROCEDURE     CRMReleaseResource(theHandle : Handle);
  82. FUNCTION     CRMGetIndex(theHandle: Handle): LONGINT;
  83.  
  84. FUNCTION     CRMLocalToRealID( bundleType:ResType; 
  85.                     toolID:INTEGER; theKind:ResType; localID:INTEGER) : INTEGER;
  86. FUNCTION     CRMRealToLocalID( bundleType:ResType; 
  87.                     toolID:INTEGER; theKind:ResType; realID:INTEGER) : INTEGER;
  88.                     
  89. FUNCTION    CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  90.  
  91. FUNCTION    CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  92.  
  93. FUNCTION     CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  94. PROCEDURE     CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  95.  
  96. {$ENDC} {UsingCommResources}
  97.  
  98. {$IFC NOT UsingIncludes}
  99.     END.
  100. {$ENDC}
  101.  
  102.